<template>
  <div class="home">Home</div>
  <p>{{ $store.state.user.name }}</p>
  <p>{{ age }}</p>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { mapState } from "vuex";

export default defineComponent({
  name: "Home",
  mounted() {
    console.log(`Home mounted`);
  },
  beforeUnmount() {
    console.log(`Home beforeUnmount`);
  },
  computed: {
    ...mapState("user", ["age"]),
  },
});
</script>

<style scoped>
.home {
  background-color: yellowgreen;
}
</style>
